Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix oms route to retrieve orders #124

Closed
wants to merge 2 commits into from

Conversation

enzomerca
Copy link
Contributor

@enzomerca enzomerca commented Aug 30, 2023

What problem is this solving?

https://vtex-dev.atlassian.net/browse/B2BTEAM-1187

On the /orders-history page on My Account (or on the order page), when clicking on the Order Again button, an error page would appear with the message: Sorry, an error occurred while processing your request.

This happens due to the oms API returning orderGroup = null when retrieving order info. The orderGroup value is used to call the checkout API and create a new cart with same items than previous order.

This PR changes the OMS API being used to a new one that actually returns the orderGroup. This new API returns mostly the same fields than previous API, and the fields that it does not return, are not used by the B2BSuite apps.

The only field that it returns a bit different is the clientProfileData.email field. Instead of returning e.g. [email protected] it returns something like: [email protected], so some changes regarding that were necessary on the b2b-orders-history app (PR)

How to test it?

Install fixed versions of b2b-organizations-graphql and b2b-orders-history apps, create an order and use the admin UI to complete it. After that, do the following:

  • Access Orders (/orders-history) from My Account;
  • Click on Order Again;
  • A cart with the items from a previous order should be created (previously an error page would appear with the message "Sorry, an error occurred while processing your request.")

Workspace

Screenshots or example usage:

Page with button to click
Captura de Tela 2023-08-30 às 15 57 15

After clicking the button:
Captura de Tela 2023-08-30 às 15 58 01

Previously, after clicking the button we would see (notice the "null" on the endpoint path):
Captura de Tela 2023-08-30 às 15 59 27

Related to / Depends on

vtex-apps/b2b-orders-history#20

@github-actions
Copy link

github-actions bot commented Aug 30, 2023

Messages
📖 ❤️ Thanks!
📖

🎉 PR additions = 5, PR deletions = 1

Generated by 🚫 dangerJS against cc276f1

@vtex-io-ci-cd
Copy link

vtex-io-ci-cd bot commented Aug 30, 2023

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@enzomerca enzomerca requested a review from a team August 30, 2023 19:16
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

warning The version of Java (11.0.17) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

Copy link
Contributor

@mairatma mairatma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. Just to be safe, it's best to wait for the other PR to be ready to they can be deployed together though, since deploying this first would cause problems with the other app, from what I understood here.

@enzomerca
Copy link
Contributor Author

Lgtm. Just to be safe, it's best to wait for the other PR to be ready to they can be deployed together though, since deploying this first would cause problems with the other app, from what I understood here.

Yes, we should deploy b2b-orders-history first! Then, after it is deployed almost everywhere, we deploy this one.

@vtex-io-docs-bot
Copy link

Beep boop 🤖

I noticed you didn't make any changes at the docs/ folder

  • There's nothing new to document 🤔
  • I'll do it later 😞

In order to keep track, I'll create an issue if you decide now is not a good time

  • I just updated 🎉🎉

@enzomerca
Copy link
Contributor Author

This PR was dropped in favor of: #125

@enzomerca enzomerca closed this Nov 16, 2023
@enzomerca enzomerca deleted the fix/B2BTEAM-1187-change-oms-route branch November 16, 2023 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants